import java.util.Arrays;

public class Main {

        public static int p(int n) {
            if (n < 10) {
                return n;
            } else {
                return n % 10 + p(n / 10);
            }
        }

        public static void main(String[] args) {
            System.out.println(p(1234));

        }

        public static int fib(int n){
            if(n==1||n==2){
                return 1;
            }
            int f1 =1 ;
            int f2 = 1;
            int f3 = 1;
            for (int i = 3; i <= n; i++) {
                f3=f1+f2;
                f1 = f2;
                f2 = f3;
            }
            return f3;
        }
        public static void main(String[] args) {
            System.out.println(fib(60));
        }

    public static void main(String[] args) {
        int[] arry={1,2,3,4};
        int[] arry2 = new int[]{1,2,3,4};
        int[] arry3 = new int[10];
        System.out.println(arry[1]);
        int len = arry.length;
        System.out.println(len);
        int n= 4;
        int[] arry4 = null;

        System.out.println(arry4);
        for (int i = 0; i < arry.length; i++) {
            System.out.print(arry[i]+" ");
        }
        //for-eash
        for (int x:arry) {
            System.out.print(x+" ");
        }
    }

    public static void main(String[] args) {
        int[] ret= fun3();
        for (int i = 0; i < ret.length; i++) {
            System.out.println(ret[i]);
        }
    }
    public static int[]   fun3(){
        int[] ret  =new int[2];
        ret[0] = 99;
        ret[1] = 199;
        return ret;
    }
    public static void main(String[] args) {
        int[] arry = {41, 22, 13, 44, 15};
        String ret = Arrays.toString(arry);//数组变字符串输出
        System.out.println(ret);
        Arrays.sort(arry,0,2);
        System.out.println(Arrays.toString(arry));
    }


}















